package com.lee.serviceprovider.message;

import com.lee.serviceprovider.model.MessageModel;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName TestMessageListener
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2020/9/20 9:42 PM
 * @Version 1.0
 */
@Slf4j
@Service
@RocketMQMessageListener(topic = "finance", consumerGroup = "consumerGroup")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class TestMessageListener implements RocketMQListener<MessageModel> {
	@Override
	public void onMessage(MessageModel messageModel) {
		log.info(messageModel.toString());
	}
}
